package com.example.demo.service;

import com.example.demo.dao.AdminMapper;
import com.example.demo.model.Userinfo;
import com.example.demo.model.vo.ArticleinfoVO;
import com.example.demo.model.vo.UserinfoVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AdminService implements AdminMapper {

    @Autowired
    private AdminMapper adminMapper;

    public List<Userinfo> getUserAll() {
        return adminMapper.getUserAll();
    }

    public int updateClose(String username) {
        return adminMapper.updateClose(username);
    }

    public int updateOpen(String username) {
        return adminMapper.updateOpen(username);
    }

    public List<ArticleinfoVO> getBookAll() {
        return adminMapper.getBookAll();
    }

    public ArticleinfoVO getApply(ArticleinfoVO articleinfoVO) {
        return adminMapper.getApply(articleinfoVO);
    }

    public int add(ArticleinfoVO articleinfoVO) {
        return adminMapper.add(articleinfoVO);
    }

    public int del(ArticleinfoVO articleinfoVO) {
        return adminMapper.del(articleinfoVO);
    }

    public List<UserinfoVO> getWriterAll() {
        return adminMapper.getWriterAll();
    }

    public UserinfoVO getWriterApply(UserinfoVO userinfoVO) {
        return adminMapper.getWriterApply(userinfoVO);
    }

    public int delWriterApply(UserinfoVO userinfoVO) {
        return adminMapper.delWriterApply(userinfoVO);
    }

    public int addWriter(UserinfoVO userinfoVO) {
        return adminMapper.addWriter(userinfoVO);
    }
}
